const hintList = [
	{
		label: 'function', //提示词
		body: 'function ${name}(${params}) {\n\t${}\n}', //填充内容
		detail: 'definition', //描述语
		type: 'function' //左边icon类型,可看@codemirror/autocomplete/dist/index.cjs
	},
	{
		label: 'forof',
		body: 'for (let ${name} of ${collection}) {\n\t${}\n}',
		type: 'keyword'
	},
	{
		label: 'do',
		body: 'do {\n\t${}\n} while (${})',
		detail: 'loop',
		type: 'keyword'
	},
	{
		label: 'while',
		body: 'while (${}) {\n\t${}\n}',
		detail: 'loop',
		type: 'keyword'
	},
	{
		label: 'try',
		body: 'try {\n\t${}\n} catch (${error}) {\n\t${}\n}',
		detail: '/ catch block',
		type: 'keyword'
	},
	{
		label: 'if',
		body: 'if (${}) {\n\t${}\n}',
		detail: 'block',
		type: 'keyword'
	},
	{
		label: 'ifelse',
		body: 'if (${}) {\n\t${}\n} else {\n\t${}\n}',
		detail: '/ else block',
		type: 'keyword'
	},
	{
		label: 'import',
		body: 'import {${names}} from "${module}"\n${}',
		detail: 'named',
		type: 'keyword'
	},
	{
		label: 'import',
		body: 'import ${name} from "${module}"\n${}',
		detail: 'default',
		type: 'keyword'
	},
	{ label: 'await', body: 'await ', type: 'keyword' },
	{ label: 'resolve', body: 'resolve ', type: 'keyword' },
	{ label: 'break', body: 'break ', type: 'keyword' },
	{ label: 'case', body: 'case ', type: 'keyword' },
	{ label: 'const', body: 'const ', type: 'keyword' },
	{ label: 'continue', body: 'continue ', type: 'keyword' },
	{ label: 'default', body: 'default ', type: 'keyword' },
	{ label: 'delete', body: 'delete ', type: 'keyword' },
	{ label: 'export', body: 'export ', type: 'keyword' },
	{ label: 'extends', body: 'extends ', type: 'keyword' },
	{ label: 'false', body: 'false ', type: 'keyword' },
	{ label: 'finally', body: 'finally ', type: 'keyword' },
	{ label: 'in', body: 'in ', type: 'keyword' },
	{ label: 'instanceof', body: 'instanceof ', type: 'keyword' },
	{ label: 'let', body: 'let ', type: 'keyword' },
	{ label: 'new', body: 'new ', type: 'keyword' },
	{ label: 'return', body: 'return ', type: 'keyword' },
	{ label: 'static', body: 'static ', type: 'keyword' },
	{ label: 'super', body: 'super ', type: 'keyword' },
	{ label: 'switch', body: 'switch ', type: 'keyword' },
	{ label: 'this', body: 'this ', type: 'keyword' },
	{ label: 'throw', body: 'throw ', type: 'keyword' },
	{ label: 'true', body: 'true ', type: 'keyword' },
	{ label: 'typeof', body: 'typeof ', type: 'keyword' },
	{ label: 'var', body: 'var ', type: 'keyword' },
	{ label: 'yield', body: 'yield ', type: 'keyword' },
	//===================以下为刘鑫自定义=====主要是抄hbuildex的一些规则
	{
		label: 'clog',
		body: 'console.log(${})',
		detail: 'console',
		type: 'keyword'
	},
	{
		label: 'funp',
		body: 'function ${name} (${arg}) {\n\treturn new Promise(resolve=>{\n\t\t${code}\n\t})\n}',
		detail: 'function-promise',
		type: 'keyword'
	},
	{
		label: 'JSON',
		body: 'JSON',
		detail: 'JSON',
		type: 'keyword'
	},
	{
		label: 'stringify',
		body: 'JSON.stringify(${})',
		detail: 'stringify',
		type: 'keyword'
	},
	{
		label: 'event',
		body: 'event',
		detail: '参数列表',
		type: 'keyword'
	},
	{
		label: 'context',
		body: 'context',
		detail: '上下文',
		type: 'keyword'
	},
	{
		label: '!',
		body: '//鉴权函数\nfunction auth(event, context) {\n    return new Promise(resolve => {\n\t\t\t\t resolve(true)  \n })\n}\n\n//主函数体，auth返回true后才会执行main函数\nfunction main(event, context) {\n    return new Promise(resolve => {\n\t\tlet {} = event\n\t\tlet result\n\n\t\t\t resolve(${result})  \n })\n}',
		detail: '模板',
		type: 'keyword'
	},
	{
		label: '！',
		body: '//鉴权函数\nfunction auth(event, context) {\n    return new Promise(resolve => {\n\t\t\t\t resolve(true)  \n })\n}\n\n//主函数体，auth返回true后才会执行main函数\nfunction main(event, context) {\n    return new Promise(resolve => {\n\t\tlet {} = event\n\t\tlet result\n\n\t\t\t resolve(${result})  \n })\n}',
		detail: '模板',
		type: 'keyword'
	},
	{
		label: 'insertOne',
		body: "result = db.collection('${}').insertOne({_userId: context._userId, createTime: new Date().getTime(),_id:new ObjectId().toString()},{})",
		detail: '插入一条数据',
		type: 'keyword'
	},
	{
		label: 'add',
		body: "result = db.collection('${}').insertOne({_userId: context._userId, createTime: new Date().getTime(),_id:new ObjectId().toString()},{})",
		detail: '插入一条数据',
		type: 'keyword'
	},
	{
		label: 'aggregate',
		body: "result = db.collection('${}').aggregate([],{}).toArray()",
		detail: '聚合查询',
		type: 'keyword'
	},
	{
		label: 'count',
		body: "result = db.collection('${}').count({},{})",
		detail: '统计个数',
		type: 'keyword'
	},
	{
		label: 'deleteOne',
		body: "result = db.collection('${}').deleteOne({},{})",
		detail: '删除',
		type: 'keyword'
	},
	{
		label: 'deleteMany',
		body: "result = db.collection('${}').deleteMany({},{})",
		detail: '删除',
		type: 'keyword'
	},
	{
		label: 'update',
		body: "result = db.collection('${}').updateMany({},{$set:{}},{})",
		detail: '更新文档',
		type: 'keyword'
	},
	{
		label: 'find',
		body: "result = db.collection('${}').find({},{}).toArray()",
		detail: '查询',
		type: 'keyword'
	},
	{
		label: 'where',
		body: "result = db.collection('${}').find({},{}).toArray()",
		detail: '查询',
		type: 'keyword'
	},
	{
		label: 'rset',
		body: "redis.set('${key}','')",
		detail: '查询',
		type: 'keyword'
	},
	{
		label: 'rget',
		body: "redis.get('${key}')",
		detail: '查询',
		type: 'keyword'
	},
	{
		label: '_id',
		body: 'var _id = ObjectId().toString()',
		detail: '生成唯一id',
		type: 'keyword'
	},
	{
		label: 'axios',
		body: "axios({\n\turl:'',\n\tmethod:'get',\n\tdata:{}\n\t}).then(res=>{\n\tresolve(res.data)//仅支持返回res.data，否则会报错。\n})",
		detail: '发起请求',
		type: 'keyword'
	},
	{
		label: 'access_token',
		body: 'var access_token = await wx.access_token()',
		detail: '获取微信accessToken',
		type: 'keyword'
	},
	{
		label: 'pay',
		body: "await wx.pay.unifiedOrder({\n\tbody:'',//商品描述\n\ttotalFee:100,//支付金额，分\n\tnotify_url:'https://lhl.starxin.link/cf1/cloud/'+'',//回调接口，只能是post\n\toutTradeNo:'',//支付订单号\n\t_openid:context._userId,//支付者的openid\n})",
		detail: '申请微信支付',
		type: 'keyword'
	},
	{
		label: 'refund',
		body: "await wx.pay.refund({\n\trefund_fee:100,//退款金额，分\n\ttotal_fee:100,//订单总金额，分\n\tnotify_url:'https://lhl.starxin.link/cf1/cloud/'+'',//回调接口，只能是post\nout_trade_no:'',//支付订单号\nout_refund_no:'',//退款订单号\n})",
		detail: '申请微信退款',
		type: 'keyword'
	},
	{
		label: 'withdraw',
		body: "await wx.pay.withdraw({\n\tout_batch_no:new Date().getTime(),//提现单号\n\ttransfer_amount:100,//提现金额，分，不能小于1元\n\tout_detail_no:'',//提现订单号\n\ttransfer_remark:'提现备注',\n\topenid:context._userId\n})",
		detail: '申请微信提现',
		type: 'keyword'
	},
	{
		label: 'decode',
		body: 'var result = await wx.pay.decode({\n\tciphertext:event.ciphertext,//数据密文	\n\tassociated_data:event.associated_data,//附加数据	\n\tnonce:event.nonce,//随机串	\n})\nvar { out_trade_no, trade_state, attach, payer, amount } = result',
		detail: '申请微信提现',
		type: 'keyword'
	},
	{
		label: 'notify',
		body: 'var result = await wx.sendUniformMessage([{"template_id":"v74FWwvdYpE4e9zHY7CrNTAwbOlaMmTnEVK09N5Ct0E","pagepath":"/package-check/pages/index/index","touser":"o6VcY5Tw5j9EAS55TPltxNu0az4M","data":{"first":{"value":"广海空间有新的帖子审核~","color":"#173177"},"keyword1":{"value":"空间审核","color":"#173177"},"keyword2":{"value":"待审核","color":"#173177"},"keyword3":{"value":"刘鑫测试","color":"#173177"},"remark":{"value":"图片","color":"#549dff"}}}])',
		detail: '获取微信accessToken',
		type: 'keyword'
	},
	{
		label: 'mediaCheckAsync',
		body: 'var result = await wx.mediaCheckAsync({ media_url:"", media_type, scene, _openid })',
		detail: '媒体资源安全检测',
		type: 'keyword'
	},
	{
		label: 'msgSecCheck',
		body: 'var result = await wx.msgSecCheck({ content, scene, _openid })',
		detail: '文本安全检测',
		type: 'keyword'
	}
]
export default hintList
